package com.kehutong.contact.entity;

import com.kehutong.common.enums.Gender;
import com.kehutong.contact.enums.*;
import org.coraframework.bean.valid.CheckField;
import org.coraframework.json.annotation.JSONField;
import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.KeyType;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.annotation.UnSave;

import java.time.LocalDateTime;
import java.util.List;

@Table(value="t_resident", comment="住户", multi=true)
public class Resident extends Entity {

	private static final long serialVersionUID = -1;

	protected Resident(String id) {
		super(id);
	}

	@Column(length = 255, comment = "头像")
	private String avatar;

	@Column(comment = "昵称")
	private String nickname;

	@CheckField("姓名不能为空")
	@Column(comment = "姓名")
	private String realname;

	@Column(comment = "姓名首字母")
	private String firstLetter;


	@Column(comment = "微信号")
	private String weixinNo;


	@CheckField("手机号不能为空")
	@Column(comment = "客户手机号")
	private String mobile;

	@Column(comment = "手机号是否有效 0无效 1有效")
	private boolean mobileValid;

	@Column(comment = "性别")
	private Gender gender;

	@Column(comment = "证件类型")
	private CardType cardType;

	@Column(comment = "证件号")
	private String cardNo;

	@Column(comment = "邮箱")
	private String email;

	@Column(comment = "生日")
	private LocalDateTime birthDay;

	@Column(comment = "住户类型")
	private ResidentType type;

	@Column(comment = "地址")
	private String address;

	@Column(length = 127, comment = "描述")
	private String remark;

	@Column(length = 127, comment = "个性签名")
	private String signature;

	@Column(length=64, comment = "客户企业简称")
	private String corpName;

	@Column(comment = "职业")
	private String offerName;

	@Column(comment = "客户分类编号")
	private String classifyId;

	@Column(comment = "客户分类")
	private String classifyName;

	@Column(comment = "跟进状态编号")
	private String stateId;

	@Column(comment = "跟进状态")
	private String stateName;

	@Column(comment = "跟记录")
	private String recordName;

	/** 数据库保存格式:111;222,3333;444(不同客户之间以“,”分隔,不同客户之间以“;”分隔)系统会自动转成以逗号分隔的集合*/
	@Column(comment = "客户标签编号")
	private List<String> tagIds;

	@Column(comment = "客户标签编号")
	private List<String> tagNames;

	@Column(comment = "打标签者，自己打的才能修改")
	private List<String> tagUsers;

	@Column(comment = "跟进者")
	private List<String> users;

	@Column(comment = "跟进者名称")
	private List<String> userNames;

	@Column(comment = "来源")
	private Source source;

	/*@Column(dbType = "TEXT",comment = "跟进用户")
    private String followUsers;*/

	@JSONField(serialize = false)
	@Column(comment = "逻辑删除")
	private boolean deleted;

	@Column(comment="启用状态")
	private boolean enable;

	/**
	 * 跟进人编号
	 */
	@UnSave
	private String userId;

	//跟进人名称
	@UnSave
	private String userName;

	//业主或租客当前编辑的房屋编号
	@UnSave
	private String houseNo;

	//业主或租客当前编辑的商铺编号
	@UnSave
	private String shopNo;

	//业主或租客当前编辑的车位编号
	@UnSave
	private String parkingNo;

	//公司编号
	@UnSave
	private String companyNo;

	//公司名称
	@UnSave
	private String companyName;

	//住户某一个身份绑定的房屋编号集合
	@UnSave
	private List<String> houseIds;

	//住户某一个身份绑定的房屋名称集合
	@UnSave
	private List<String> houseNames;

	//住户某一个身份绑定的房屋编号是否认证结果集合
	@UnSave
	private List<Boolean> authHouseIds;


	//设置业主列表绑定的房屋信息
	@UnSave
	private String bindHouse;


	//住户某一个身份绑定的商铺编号集合
	@UnSave
	private List<String> shopIds;

	//住户某一个身份绑定的商铺名称集合
	@UnSave
	private List<String> shopNames;

	//住户某一个身份绑定的商铺编号是否认证结果集合
	@UnSave
	private List<Boolean> authShopIds;

	//设置业主列表绑定的商铺信息
	@UnSave
	private String bindShop;


	//住户某一个身份绑定的车位编号集合
	@UnSave
	private List<String> parkingIds;

	//住户某一个身份绑定的车位名称集合
	@UnSave
	private List<String> parkingNames;

	//住户某一个身份绑定的车位编号是否认证结果集合
	@UnSave
	private List<Boolean> authParkingIds;

	//设置业主列表绑定的车位信息
	@UnSave
	private String bindParking;


	//住户房屋关系编号集合,根据传入业主类型放入不同类型的房屋关系数据
	//如果是业主则是业主的房屋关系集合
	//如果是家属则是租户的房屋关系集合
	//如果是租客则是租户的房屋关系集合
	@UnSave
	private List<String> residentHouseIds;

	@UnSave
	private List<String> residentShopIds;


	@UnSave
	private List<String> residentParkingIds;

	//与业主的关系
	@UnSave
	private RelationType relationType;

	//租赁开始时间
	@UnSave
	private LocalDateTime startTime;

	//租赁结束时间
	@UnSave
	private LocalDateTime endTime;

	//房屋类型
	@UnSave
	private HouseType houseType;


	//创建人
	@UnSave
	private String createBy;

	//创建人名称
	@UnSave
	private String createName;


	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public LocalDateTime getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(LocalDateTime birthDay) {
		this.birthDay = birthDay;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Source getSource() {
		return source;
	}

	public void setSource(Source source) {
		this.source = source;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public ResidentType getType() {
		return type;
	}

	public void setType(ResidentType type) {
		this.type = type;
	}

	public String getCorpName() {
		return corpName;
	}

	public void setCorpName(String corpName) {
		this.corpName = corpName;
	}

	public String getOfferName() {
		return offerName;
	}

	public void setOfferName(String offerName) {
		this.offerName = offerName;
	}

	public String getClassifyName() {
		return classifyName;
	}

	public void setClassifyName(String classifyName) {
		this.classifyName = classifyName;
	}

	public String getStateName() {
		return stateName;
	}

	public void setStateName(String stateName) {
		this.stateName = stateName;
	}

	public String getRecordName() {
		return recordName;
	}

	public void setRecordName(String recordName) {
		this.recordName = recordName;
	}

	public List<String> getTagIds() {
		return tagIds;
	}

	public void setTagIds(List<String> tagIds) {
		this.tagIds = tagIds;
	}

	public List<String> getTagNames() {
		return tagNames;
	}

	public void setTagNames(List<String> tagNames) {
		this.tagNames = tagNames;
	}

	public List<String> getTagUsers() {
		return tagUsers;
	}

	public void setTagUsers(List<String> tagUsers) {
		this.tagUsers = tagUsers;
	}

	public List<String> getUsers() {
		return users;
	}

	public void setUsers(List<String> users) {
		this.users = users;
	}

	public String getClassifyId() {
		return classifyId;
	}

	public void setClassifyId(String classifyId) {
		this.classifyId = classifyId;
	}

	public String getStateId() {
		return stateId;
	}

	public void setStateId(String stateId) {
		this.stateId = stateId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}


	public List<String> getUserNames() {
		return userNames;
	}

	public void setUserNames(List<String> userNames) {
		this.userNames = userNames;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getHouseNo() {
		return houseNo;
	}

	public void setHouseNo(String houseNo) {
		this.houseNo = houseNo;
	}

	public String getCompanyNo() {
		return companyNo;
	}

	public void setCompanyNo(String companyNo) {
		this.companyNo = companyNo;
	}

	public String getBindHouse() {
		return bindHouse;
	}

	public void setBindHouse(String bindHouse) {
		this.bindHouse = bindHouse;
	}


	public List<String> getHouseIds() {
		return houseIds;
	}

	public void setHouseIds(List<String> houseIds) {
		this.houseIds = houseIds;
	}

	public List<String> getHouseNames() {
		return houseNames;
	}

	public void setHouseNames(List<String> houseNames) {
		this.houseNames = houseNames;
	}


	public RelationType getRelationType() {
		return relationType;
	}

	public void setRelationType(RelationType relationType) {
		this.relationType = relationType;
	}

	public LocalDateTime getStartTime() {
		return startTime;
	}

	public void setStartTime(LocalDateTime startTime) {
		this.startTime = startTime;
	}

	public LocalDateTime getEndTime() {
		return endTime;
	}

	public void setEndTime(LocalDateTime endTime) {
		this.endTime = endTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getSignature() {
		return signature;
	}

	public void setSignature(String signature) {
		this.signature = signature;
	}

	public List<String> getResidentHouseIds() {
		return residentHouseIds;
	}

	public void setResidentHouseIds(List<String> residentHouseIds) {
		this.residentHouseIds = residentHouseIds;
	}

	public CardType getCardType() {
		return cardType;
	}

	public void setCardType(CardType cardType) {
		this.cardType = cardType;
	}

	public List<Boolean> getAuthHouseIds() {
		return authHouseIds;
	}

	public void setAuthHouseIds(List<Boolean> authHouseIds) {
		this.authHouseIds = authHouseIds;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public boolean isMobileValid() {
		return mobileValid;
	}

	public void setMobileValid(boolean mobileValid) {
		this.mobileValid = mobileValid;
	}

	public List<String> getShopIds() {
		return shopIds;
	}

	public void setShopIds(List<String> shopIds) {
		this.shopIds = shopIds;
	}

	public List<String> getShopNames() {
		return shopNames;
	}

	public void setShopNames(List<String> shopNames) {
		this.shopNames = shopNames;
	}

	public List<Boolean> getAuthShopIds() {
		return authShopIds;
	}

	public void setAuthShopIds(List<Boolean> authShopIds) {
		this.authShopIds = authShopIds;
	}

	public String getBindShop() {
		return bindShop;
	}

	public void setBindShop(String bindShop) {
		this.bindShop = bindShop;
	}

	public List<String> getParkingIds() {
		return parkingIds;
	}

	public void setParkingIds(List<String> parkingIds) {
		this.parkingIds = parkingIds;
	}

	public List<String> getParkingNames() {
		return parkingNames;
	}

	public void setParkingNames(List<String> parkingNames) {
		this.parkingNames = parkingNames;
	}

	public List<Boolean> getAuthParkingIds() {
		return authParkingIds;
	}

	public void setAuthParkingIds(List<Boolean> authParkingIds) {
		this.authParkingIds = authParkingIds;
	}

	public String getBindParking() {
		return bindParking;
	}

	public void setBindParking(String bindParking) {
		this.bindParking = bindParking;
	}

	public String getShopNo() {
		return shopNo;
	}

	public void setShopNo(String shopNo) {
		this.shopNo = shopNo;
	}

	public String getParkingNo() {
		return parkingNo;
	}

	public void setParkingNo(String parkingNo) {
		this.parkingNo = parkingNo;
	}

	public List<String> getResidentShopIds() {
		return residentShopIds;
	}

	public void setResidentShopIds(List<String> residentShopIds) {
		this.residentShopIds = residentShopIds;
	}

	public List<String> getResidentParkingIds() {
		return residentParkingIds;
	}

	public void setResidentParkingIds(List<String> residentParkingIds) {
		this.residentParkingIds = residentParkingIds;
	}

	public HouseType getHouseType() {
		return houseType;
	}

	public void setHouseType(HouseType houseType) {
		this.houseType = houseType;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getWeixinNo() {
		return weixinNo;
	}

	public void setWeixinNo(String weixinNo) {
		this.weixinNo = weixinNo;
	}

	public String getFirstLetter() {
		return firstLetter;
	}

	public void setFirstLetter(String firstLetter) {
		this.firstLetter = firstLetter;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public String getCreateName() {
		return createName;
	}

	public void setCreateName(String createName) {
		this.createName = createName;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}
}
